home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fabulous Photos
/
Fabulous Photos.iso
/
pc
/
photoshp
/
photoshp.mst
< prev
next >
Wrap
Text File
|
1994-12-18
|
18KB
|
575 lines
'* Adobe Photoshop Installer
'*
'* June 5, 1993 Marshall Spight (original Premiere ver)
'* June 16, 1993 Dave Corboy (modified for Photoshop)
'*
'*
'*
'*
'$DEFINE DEBUG ''Define for script development/debugging
'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetect.inc'
CONST A$ = "Adobe Photoshop requires Microsoft Windows version 3.10 or greater. Please upgrade your version of Windows."
CONST B$ = "Installation Problem"
CONST C$ = "Setup sources were corrupted!"
''following were taken from windows.h. &H means they're hex
CONST WS_VISIBLE=&H10000000
CONST WS_BORDER =&H00800000
CONST WS_CLIPCHILDREN =&H02000000
CONST GWL_STYLE =-16
CONST SW_SHOWMAXIMIZED=3
DECLARE FUNCTION ShowWindow LIB "user.exe" (hWnd%,iShow%) AS INTEGER
DECLARE FUNCTION SetWindowLong LIB "user.exe" (hWnd%, offset%, style&) AS LONG
''Dialog ID's
CONST ASKQUIT = 100
CONST TRIAL1 = 101
CONST DESTPATH = 200
CONST EXITFAILURE = 300
CONST EXITQUIT = 400
CONST EXITSUCCESS = 500
CONST OPTIONS = 600
CONST APPHELP = 700
CONST CUSTINST = 800
CONST TOOBIG = 900
CONST BADPATH = 1000
CONST PERSONALIZE = 10000
''Bitmap ID
CONST LOGO = 1
''File Types
CONST PROGRAMFILES = 1
CONST TUTORIALFILES = 2
CONST PATTERNFILES = 3
CONST DUOTONEFILES = 4
CONST FILTERFILES = 5
CONST NUMGROUPS = 5 '' Number of file groups: PROGRAM to TUTORIAL
GLOBAL DEST$ ''Default destination directory.
GLOBAL WINDRIVE$ ''Windows drive letter.
GLOBAL ENOUGHDISK% ''Enough space to install
''CustInst list symbol names
GLOBAL PROGRAMNEEDS$
GLOBAL TUTORIALNEEDS$
GLOBAL PATTERNNEEDS$
GLOBAL DUOTONENEEDS$
GLOBAL FILTERNEEDS$
GLOBAL EXTRACOSTS$ ''List of extra costs to add per drive
GLOBAL BIGLIST$ ''List of option files cost calc results (boolean)
''Dialog list symbol names
GLOBAL CHECKSTATES$
GLOBAL STATUSTEXT$
GLOBAL DRIVETEXT$
DECLARE SUB AddOptFilesToCopyList (ftype%, bogus%)
DECLARE SUB RecalcOptFiles (ftype%)
DECLARE SUB RecalcPath
DECLARE SUB SetDriveStatus
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
DECLARE SUB X1 LIB "mscuistf.dll" (arg$)
DECLARE SUB X2 LIB "mscuistf.dll" (arg$)
DECLARE SUB X3 LIB "mscuistf.dll" (arg$)
DECLARE SUB FixScreenProc LIB "mscuistf.dll" (arg%)
INIT:
hWnd%=HwndFrame()
FixScreenProc ( hWnd% )
SWLxx&=SetWindowLong(hWnd%,GWL_STYLE,WS_VISIBLE+WS_BORDER+WS_CLIPCHILDREN)
SWyy%=ShowWindow(hWnd%,SW_SHOWMAXIMIZED)
INSTALLDLL$ = "mscuistf.dll" ''custom functions
HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
SetBitmap INSTALLDLL$, LOGO
SetTitle "Adobe Photoshop Installer"
MajorVer% = GetWindowsMajorVersion()
MinorVer% = GetWindowsMinorVersion()
IF MajorVer% < 3 OR (MajorVer% = 3 AND MinorVer% < 10) THEN
i% = DoMsgBox(A$, B$, MB_OK+MB_TASKMODAL+MB_ICONHAND)
END
END IF
szInf$ = GetSymbolValue("STF_SRCINFPATH")
IF szInf$ = "" THEN
szInf$ = GetSymbolValue("STF_CWDDIR") + "PHOTOSHP.INF"
END IF
ReadInfFile szInf$
WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
DEST$ = WINDRIVE$ + ":\PHOTOSHP"
''CustInst list symbols
CHECKSTATES$ = "CheckItemsState"
STATUSTEXT$ = "StatusItemsText"
DRIVETEXT$ = "DriveStatusText"
AddListItem CHECKSTATES$, "ON"
FOR i% = 2 TO NUMGROUPS STEP 1
AddListItem CHECKSTATES$, "OFF"
NEXT i%
FOR i% = 1 TO NUMGROUPS STEP 1
AddListItem STATUSTEXT$, ""
NEXT i%
FOR i% = 1 TO 7 STEP 1
AddListItem DRIVETEXT$, ""
NEXT i%
ReplaceListItem DRIVETEXT$, 7, DEST$
''Disk cost list symbols
PROGRAMNEEDS$ = "ProgramNeeds"
TUTORIALNEEDS$ = "TutorialNeeds"
PATTERNNEEDS$ = "PatternNeeds"
DUOTONENEEDS$ = "DuotoneNeeds"
FILTERNEEDS$ = "FilterNeeds"
EXTRACOSTS$ = "ExtraCosts"
BIGLIST$ = "BigList"
FOR i% = 1 TO NUMGROUPS STEP 1
AddListItem BIGLIST$, ""
NEXT i%
FOR i% = 1 TO 26 STEP 1
AddListItem EXTRACOSTS$, "0"
NEXT i%
RecalcPath
SetDriveStatus
'$IFDEF DEBUG
i% = SetSizeCheckMode(scmOnIgnore) '' could use scmOff; def = scmOnFatal
'$ENDIF ''DEBUG
INTRO:
sz$ = UIStartDlg(INSTALLDLL$, TRIAL1, "FInfo0DlgProc", 0, "" )
IF sz$ = "CONTINUE" THEN
UIPop 1
GOTO CUSTINST
ELSEIF sz$ = "REACTIVATE" THEN
GOTO INTRO
ELSE
UIPopAll
ERROR STFQUIT
END IF
CUSTINST:
sz$ = UIStartDlg(INSTALLDLL$, CUSTINST, "FCustInstDlgProc", APPHELP, HELPPROC$)
IF sz$ = "CONTINUE" THEN
''Install only if it will fit.
IF ENOUGHDISK% = 0 THEN
GOSUB TOOBIG
GOTO CUSTINST
END IF
UIPop 1
GOTO INSTALL
ELSEIF sz$ = "PATH" THEN
GOTO GETPATH
ELSEIF sz$ = "CHK1" THEN
RecalcOptFiles PROGRAMFILES
SetDriveStatus
GOTO CUSTINST
ELSEIF sz$ = "CHK2" THEN
RecalcOptFiles TUTORIALFILES
SetDriveStatus
GOTO CUSTINST
ELSEIF sz$ = "CHK3" THEN
RecalcOptFiles PATTERNFILES
SetDriveStatus
GOTO CUSTINST
ELSEIF sz$ = "CHK4" THEN
RecalcOptFiles DUOTONEFILES
SetDriveStatus
GOTO CUSTINST
ELSEIF sz$ = "CHK5" THEN
RecalcOptFiles FILTERFILES
SetDriveStatus
GOTO CUSTINST
ELSEIF sz$ = "REACTIVATE" THEN
RecalcPath
SetDriveStatus
GOTO CUSTINST
ELSE
GOSUB ASKQUIT
GOTO CUSTINST
END IF
INSTALL:
CreateDir DEST$, cmoNone
IF GetListItem( CHECKSTATES$, PROGRAMFILES ) = "ON" THEN
RemoveFile GetWindowsDir() + "PHOTOSHP.INI", cmoNone
'' RemoveFile GetWindowsDir() + "PHOTOSHP.PSP", cmoNone
CreateDir DEST$ + "\PLUGINS", cmoNone
'' CreateDir DEST$ + "\CALIBRAT", cmoNone
'' CreateDir DEST$ + "\BRUSHES", cmoNone
'' CreateDir DEST$ + "\PALETTES", cmoNone
END IF
ClearCopyList
AddOptFilesToCopyList PROGRAMFILES, 0
CopyFilesInCopyList
IF GetListItem(CHECKSTATES$, PROGRAMFILES) = "ON" THEN
CreateProgmanGroup "Adobe", "", cmoNone
ShowProgmanGroup "Adobe", 1, cmoNone
CreateProgmanItem "Adobe", "Photoshop 2.5.1 Tryout", MakePath( DEST$, "photoshp.exe" ), "", cmoOverwrite
CreateProgmanItem "Adobe", "Photoshop ReadMe", "notepad.exe " + MakePath( DEST$, "psreadme.txt" ), "", cmoOverwrite
''Updating PHOTOSHOP.INI and SYSTEM.INI
CreateIniKeyValue GetWindowsDir() + "photoshp.ini", "Photoshop", "PHOTOSHOPDIRECTORY", DEST$, cmoOverwrite
CreateIniKeyValue GetWindowsDir() + "photoshp.ini", "Photoshop", "PLUGINDIRECTORY", DEST$ + "\PLUGINS", cmoOverwrite
CopyFile GetWindowsDir() + "system.ini", GetWindowsDir() + "system.bak", cmoOverwrite, 0
CreateIniKeyValue GetWindowsDir() + "system.ini", "drivers", "adobekey", "adobekey.drv", cmoOverwrite
CreateIniKeyValue GetWindowsDir() + "system.ini", "drivers", "adobemse", "adobemse.drv", cmoOverwrite
X$ = "Adobe Photoshop Tryout Version "
R$ = CHR$(40) + X$
X$ = " "
R$ = R$ + CHR$(40) + X$
StampResource "SplitFiles", "Stamp", DEST$, 6, &H276, R$, 82
END IF
QUIT:
ON ERROR GOTO ERRQUIT
IF ERR = 0 THEN
dlg% = EXITSUCCESS
ELSEIF ERR = STFQUIT THEN
dlg% = EXITQUIT
ELSE
dlg% = EXITFAILURE
END IF
QUITL1:
sz$ = UIStartDlg(INSTALLDLL$, dlg%, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO QUITL1
END IF
UIPop 1
END
ERRQUIT:
i% = DoMsgBox(C$, B$, MB_OK+MB_TASKMODAL+MB_ICONHAND)
END
GETPATH:
SetSymbolValue "EditTextIn", DEST$
SetSymbolValue "EditFocus", "END"
GETPATHL1:
sz$ = UIStartDlg(INSTALLDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
IF sz$ = "CONTINUE" THEN
olddest$ = DEST$
DEST$ = GetSymbolValue("EditTextOut")
''Validate new path.
IF IsDirWritable(DEST$) = 0 THEN
GOSUB BADPATH
GOTO GETPATHL1
END IF
UIPop 1
''Truncate display if too long.
IF LEN(DEST$) > 23 THEN
ReplaceListItem DRIVETEXT$, 7, MID$(DEST$, 1, 23)+"..."
ELSE
ReplaceListItem DRIVETEXT$, 7, DEST$
END IF
''Recalc if path changed.
IF (olddest$ <> DEST$) AND (olddest$ <> DEST$+"\") AND (olddest$+"\" <> DEST$) THEN
RecalcPath
SetDriveStatus
END IF
olddest$ = ""
GOTO CUSTINST
ELSEIF sz$ = "REACTIVATE" THEN
RecalcPath
SetDriveStatus
GOTO GETPATHL1
ELSEIF sz$ = "EXIT" THEN
GOSUB ASKQUIT
GOTO GETPATHL1
ELSE
UIPop 1
GOTO CUSTINST
END IF
TOOBIG:
sz$ = UIStartDlg(INSTALLDLL$, TOOBIG, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
RecalcPath
SetDriveStatus
GOTO TOOBIG
END IF
UIPop 1
RETURN
BADPATH:
sz$ = UIStartDlg(INSTALLDLL$, BADPATH, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
RecalcPath
SetDriveStatus
GOTO BADPATH
END IF
UIPop 1
RETURN
ASKQUIT:
sz$ = UIStartDlg(INSTALLDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
IF sz$ = "EXIT" THEN
UIPopAll
ERROR STFQUIT
ELSEIF sz$ = "REACTIVATE" THEN
GOTO ASKQUIT
ELSE
UIPop 1
END IF
RETURN
'**
'** Purpose:
'** Adds the specified option files to the copy list.
'** Arguments:
'** ftype% - type of files to add, one of the following:
'** PROGRAMFILES, DUOTONEFILES ...
'** Returns:
'** none.
'*************************************************************************
SUB AddOptFilesToCopyList (ftype%, bogus%) STATIC
IF GetListItem(CHECKSTATES$, ftype%) = "ON" THEN
SrcDir$ = GetSymbolValue("STF_SRCDIR")
IF ftype% = PROGRAMFILES THEN
AddSectionFilesToCopyList "ProgramFiles", SrcDir$, DEST$
AddSectionFilesToCopyList "PluginFiles", SrcDir$, DEST$ + "\plugins"
AddSectionFilesToCopyList "ProgramWinFiles", SrcDir$, GetWindowsDir()
AddSectionFilesToCopyList "ProgramWinSysFiles", SrcDir$, GetWindowsSysDir()
'' AddSectionFilesToCopyList "CalibrateFiles", SrcDir$, DEST$ + "\calibrat"
'' AddSectionFilesToCopyList "BrushFiles", SrcDir$, DEST$ + "\brushes"
'' AddSectionFilesToCopyList "PaletteFiles", SrcDir$, DEST$ + "\palettes"
IF bogus% = 1 THEN
AddSectionFilesToCopyList "BogusFiles", SrcDir$, DEST$
ELSE
AddSectionFilesToCopyList "SplitFiles", SrcDir$, DEST$
END IF
ELSEIF ftype% = TUTORIALFILES THEN
AddSectionFilesToCopyList "TutorialFiles", SrcDir$, DEST$ + "\tutorial"
ELSEIF ftype% = PATTERNFILES THEN
AddSectionFilesToCopyList "PatternFiles", SrcDir$, DEST$ + "\patterns"
ELSEIF ftype% = DUOTONEFILES THEN
AddSectionFilesToCopyList "DuoDuoPms", SrcDir$, DEST$ + "\duotones\duotone\pms"
AddSectionFilesToCopyList "DuoDuoProc", SrcDir$, DEST$ + "\duotones\duotone\process"
AddSectionFilesToCopyList "DuoDuoGray", SrcDir$, DEST$ + "\duotones\duotone\gray"
AddSectionFilesToCopyList "DuoTriPms", SrcDir$, DEST$ + "\duotones\tritone\pms"
AddSectionFilesToCopyList "DuoTriProc", SrcDir$, DEST$ + "\duotones\tritone\process"
AddSectionFilesToCopyList "DuoTriGray", SrcDir$, DEST$ + "\duotones\tritone\gray"
AddSectionFilesToCopyList "DuoQuadPms", SrcDir$, DEST$ + "\duotones\quadtone\pms"
AddSectionFilesToCopyList "DuoQuadProc", SrcDir$, DEST$ + "\duotones\quadtone\process"
AddSectionFilesToCopyList "DuoQuadGray", SrcDir$, DEST$ + "\duotones\quadtone\gray"
ELSEIF ftype% = FILTERFILES THEN
AddSectionFilesToCopyList "FilterFiles", SrcDir$, DEST$ + "\plugins"
AddSectionFilesToCopyList "FilterDispFiles", SrcDir$, DEST$ + "\plugins\dispmaps"
AddSectionFilesToCopyList "FilterVideoFiles", SrcDir$, DEST$ + "\plugins\video"
AddSectionFilesToCopyList "ThirdPartyFiles", SrcDir$, DEST$ + "\3rdparty"
AddSectionFilesToCopyList "XL77xxFiles", SrcDir$, DEST$ + "\3rdparty\xl77xx"
AddSectionFilesToCopyList "XL77xxTableFiles", SrcDir$, DEST$ + "\3rdparty\xl77xx\tables"
END IF
SrcDir$ = ""
END IF
END SUB
'**
'** Purpose:
'** Recalculates disk space for the given option files and sets
'** the status info symbol "StatusItemsText".
'** Arguments:
'** ftype% - type of files to add, one of the following:
'** PROGRAMFILES, PLUGINFILES...
'** Returns:
'** none.
'*************************************************************************
SUB RecalcOptFiles (ftype%) STATIC
CursorSave% = ShowWaitCursor()
ClearCopyList
AddOptFilesToCopyList ftype%, 1
fExtra% = 0
IF ftype% = PROGRAMFILES THEN
ListSym$ = PROGRAMNEEDS$
IF GetListItem(CHECKSTATES$, PROGRAMFILES) = "ON" THEN
''Add extra cost to Windows drive for ini/progman, etc.
ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
ReplaceListItem EXTRACOSTS$, ndrive%, "10240"
fExtra% = 1
END IF
ELSEIF ftype% = TUTORIALFILES THEN
ListSym$ = TUTORIALNEEDS$
ELSEIF ftype% = PATTERNFILES THEN
ListSym$ = PATTERNNEEDS$
ELSEIF ftype% = DUOTONEFILES THEN
ListSym$ = DUOTONENEEDS$
ELSEIF ftype% = FILTERFILES THEN
ListSym$ = FILTERNEEDS$
END IF
StillNeed& = GetCopyListCost(EXTRACOSTS$, ListSym$, "")
cost& = 0
FOR i% = 1 TO 26 STEP 1
cost& = cost& + VAL(GetListItem(ListSym$, i%))
NEXT i%
ReplaceListItem STATUSTEXT$, ftype%, STR$(cost& / 1024) + " K"
IF StillNeed& > 0 THEN
ReplaceListItem BIGLIST$, ftype%, "YES"
ELSE
ReplaceListItem BIGLIST$, ftype%, ""
END IF
IF fExtra% THEN
ReplaceListItem EXTRACOSTS$, ndrive%, "0"
END IF
RestoreCursor CursorSave%
ListSym$ = ""
END SUB
'**
'** Purpose:
'** Recalculates disk space and sets option status info according
'** to the current destination path.
'** Arguments:
'** none.
'** Returns:
'** none.
'*************************************************************************
SUB RecalcPath STATIC
CursorSave% = ShowWaitCursor()
RecalcOptFiles PROGRAMFILES
RecalcOptFiles TUTORIALFILES
RecalcOptFiles PATTERNFILES
RecalcOptFiles DUOTONEFILES
RecalcOptFiles FILTERFILES
RestoreCursor CursorSave%
END SUB
'**
'** Purpose:
'** Sets drive status info according to latest disk space calcs.
'** Arguments:
'** none.
'** Returns:
'** none.
'*************************************************************************
SUB SetDriveStatus STATIC
ENOUGHDISK% = 1
drive$ = MID$(DEST$, 1, 1)
ndrive% = ASC(ucase$(drive$)) - ASC("A") + 1
cost& = VAL( GetListItem( PROGRAMNEEDS$, ndrive% ) )
cost& = cost& + VAL( GetListItem( TUTORIALNEEDS$, ndrive% ) )
cost& = cost& + VAL( GetListItem( PATTERNNEEDS$, ndrive% ) )
cost& = cost& + VAL( GetListItem( DUOTONENEEDS$, ndrive% ) )
cost& = cost& + VAL( GetListItem( FILTERNEEDS$, ndrive% ) )
free& = GetFreeSpaceForDrive(drive$)
ReplaceListItem DRIVETEXT$, 1, drive$ + ":"
ReplaceListItem DRIVETEXT$, 2, STR$(cost& / 1024) + " K"
ReplaceListItem DRIVETEXT$, 3, STR$(free& / 1024) + " K"
IF cost& > free& THEN
ENOUGHDISK% = 0
END IF
IF drive$ = WINDRIVE$ THEN
ReplaceListItem DRIVETEXT$, 4, ""
ReplaceListItem DRIVETEXT$, 5, ""
ReplaceListItem DRIVETEXT$, 6, ""
ELSE
ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
cost& = VAL( GetListItem( PROGRAMNEEDS$, ndrive% ) )
cost& = cost& + VAL( GetListItem( TUTORIALNEEDS$, ndrive% ) )
cost& = cost& + VAL( GetListItem( PATTERNNEEDS$, ndrive% ) )
cost& = cost& + VAL( GetListItem( DUOTONENEEDS$, ndrive% ) )
cost& = cost& + VAL( GetListItem( FILTERNEEDS$, ndrive% ) )
IF cost& = 0 THEN
ReplaceListItem DRIVETEXT$, 4, ""
ReplaceListItem DRIVETEXT$, 5, ""
ReplaceListItem DRIVETEXT$, 6, ""
ELSE
free& = GetFreeSpaceForDrive(WINDRIVE$)
ReplaceListItem DRIVETEXT$, 4, WINDRIVE$ + ":"
ReplaceListItem DRIVETEXT$, 5, STR$(cost& / 1024) + " K"
ReplaceListItem DRIVETEXT$, 6, STR$(free& / 1024) + " K"
IF cost& > free& THEN
ENOUGHDISK% = 0
END IF
END IF
END IF
END SUB
'**
'** Purpose:
'** Appends a file name to the end of a directory path,
'** inserting a backslash character as needed.
'** Arguments:
'** szDir$ - full directory path (with optional ending "\")
'** szFile$ - filename to append to directory
'** Returns:
'** Resulting fully qualified path name.
'*************************************************************************
FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
IF szDir$ = "" THEN
MakePath = szFile$
ELSEIF szFile$ = "" THEN
MakePath = szDir$
ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
MakePath = szDir$ + szFile$
ELSE
MakePath = szDir$ + "\" + szFile$
END IF
END FUNCTION